﻿using System;
using System.Collections.Generic;

namespace Tilver.Coder.Core
{
    [Serializable]
    public class CoderTable : CoderTabular
    {
        /// <summary>
        /// 结构类型
        /// </summary>
        public override TabularTypeEnum TabularType
        {
            get { return TabularTypeEnum.Table; }
        }
        /// <summary>
        /// 是否有主健
        /// </summary>
        public override bool HasPrimaryKey { get { return PrimaryKey != null; } }
        

        private List<CoderIndex> _indexs;
        /// <summary>
        /// 索引集合
        /// </summary>
        public List<CoderIndex> Indexes 
        {
            get { if (_indexs == null) { _indexs = new List<CoderIndex>(); } return _indexs; }
            set { _indexs = value; }
        }

        private List<CoderTableKey> _foreignKeys;
        /// <summary>
        /// 外键集合
        /// </summary>
        public List<CoderTableKey> ForeignKeys
        {
            get { if (_foreignKeys == null) { _foreignKeys = new List<CoderTableKey>(); } return _foreignKeys; }
            set { _foreignKeys = value; }
        }

        
    }
}
